package com.lanchetech.dao;

import com.lanchetech.bean.vo.BargainSkuVO;import com.lanchetech.entity.BargainSku;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface BargainSkuMapper {
    int deleteByPrimaryKey(Long id);

    int insert(BargainSku record);

    int insertSelective(BargainSku record);

    BargainSku selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(BargainSku record);

    int updateByPrimaryKey(BargainSku record);

    int updateBatch(List<BargainSku> list);

    int updateBatchSelective(List<BargainSku> list);

    int batchInsert(@Param("list") List<BargainSku> list);

    List<BargainSkuVO> findAllByActivityId(@Param("activityId") Long activityId);

    int deleteByActivityIdAndSpuIds(@Param("activityId") Long activityId, @Param("spuIds") long[] spuIds);

    List<BargainSku> findAllByActivityIdAndSpuId(@Param("activityId") Long activityId, @Param("spuId") Long spuId);

    BargainSku findOneByActivityIdAndSkuId(@Param("activityId")Long activityId,@Param("skuId")Long skuId);

    int updateStockAndSalesByActivityIdAndSkuId(@Param("updatedStock")Integer updatedStock,@Param("activityId")Long activityId,@Param("skuId")Long skuId);

    List<BargainSku> findAllByActivityIds(@Param("activityIds") List<Long> activityIds);

}